package com.jjmo.edu.info.manger.dao;

import com.jjmo.edu.info.manger.domain.Student;

public class StudentDao {
    Student[] students = new Student[5];
    public boolean addStudent(Student student) {

        int index = -1;
        for (int i = 0; i < students.length; i++) {
            Student stu = students[i];
            if (stu == null) {
                index = i;
                break;
            }
        }
        if (index == -1) {
            return false;
        } else {
            students[index] = student;
            return true;
        }
    }

    public Student[] findAllStudent() {
        return students;
    }
}
